
#define MAX_TURN 2000
#define MAX_BRANCH 1
#define MAX_NUM 3000000
#define WEIGHTS 1
#define MAX_SIGLE 6

struct info
{
	short matrixArr[20][20];
	int clourN;
	int matrixN;
};

typedef struct info Info;

struct turnInfo
{
	short x;
	short y;
	short length;
	short angle;
};

typedef struct turnInfo TurnInfo;

typedef struct MapTurn
{
	Info map;
	short turn[MAX_TURN];
	int value;
}MapTurn;

typedef struct QNode
{
	MapTurn data;
	struct QNode *next;
}QNode;

typedef struct {
	QNode *front;
	QNode *rear;

}LinkQueue;

int ReadInfo(Info *conf);
int JudgeCom(Info conf);
Info Turn(Info map, TurnInfo turnInfo);
int GetPosition(short arr[MAX_TURN]);
int	DeQueue(LinkQueue *Q,MapTurn *E);
int DestroyQueue(LinkQueue *Q);
int	EnQueue(LinkQueue *Q,MapTurn E);
int InitQueue(LinkQueue *Q);
int JudgeSymme(Info map, TurnInfo turnInfo);
int JudgeColorValue(Info conf);
int TraverseTree(MapTurn *mapTurn, LinkQueue *linkQ);
void Sort(MapTurn *mapturnArr,int n,MapTurn mapTurn);
int MoveCentre(Info map,int colorN[8]);
void PrintColourValue(Info conf);
void OutputResult(short arr[MAX_TURN]);
int MoveSigle(Info conf,int colorN[8]);
void SearchCentre(Info map,int *color);
